package com.swlz.servlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;

import com.swlz.R;
import com.swlz.entity.Areas;
import com.swlz.service.AreasService;
import com.swlz.service.impl.AreasServiceImpl;
import com.swlz.servlet.HttpServletSupport;

/**
 * <pre>
 * - JSON控制器
 * - 行政区域
 * ClassName : com.swlz.servlet.demo.AreasServlet
 * Author : swlz
 * E-Mail : 2233875735@qq.com
 * Date : 2020-07-02 23:48:46
 * Version : 1.0
 * Copyright 2020 swlz.top Inc. All rights reserved. 
 * Warning: this content is only for internal circulation of the company. It is forbidden to divulge it or use it for other commercial purposes
 * </pre>
 **/
@SuppressWarnings("serial")
@WebServlet("/areas.let")
public class AreasServlet extends HttpServletSupport {
	
	private AreasService areasService = new AreasServiceImpl();
	
	public Object execute(Areas areas)throws Exception {
		return areasService.listChildren(areas.getPid());
	}
	
	public Object get(Areas areas)throws Exception {
		return areasService.get(areas.getId());
	}
	
	public Object list(Areas areas)throws Exception {
		return areasService.list(areas.getId());
	}
	
	public Object name(Areas areas)throws Exception {
		return areasService.getName(areas.getId());
	}
	
	
}